package com.servlet;

import com.Dao.BorrowDao;
import com.bean.BorrowBean;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.ArrayList;

@WebServlet(name = "MybServlet", value = "/MybServlet")
public class MybServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        response.setContentType("text/html;charset=UTF-8");
        String Name = request.getParameter("name");
        request.setAttribute("name2", Name);
        BorrowDao borrowdao = new BorrowDao();
        ArrayList<BorrowBean> list1 = borrowdao.getList(Name);
        request.getSession().setAttribute("list4", list1);
        request.getRequestDispatcher("index_user.jsp").forward(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
